package com.dfbz.demo02_Writer;

import java.io.FileWriter;
import java.io.Writer;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01_FileWriter写出字符 {
    public static void main(String[] args)throws Exception {

        // 字符输出流中有缓冲区的概念
        Writer writer=new FileWriter("001.txt");

        char[] data = {'烧','鸭','饭'};
        writer.write(20320);
        writer.write('你');
        writer.write("白切鸡");
        writer.write(data);


        // 刷新缓冲区,将缓冲区的内容刷新到磁盘
//        writer.flush();

        // 在调用close的时候,会默认先调用flush
        writer.close();
    }
}
